// custom-tab-bar/custom-tab-bar.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    actived: 0, // 选中的tabbar
    "list": [{
        "pagePath": "/pages/index/index",
        "text": "首页",
        "iconPath": "/static/index.png",
        "selectedIconPath": "/static/index_actived.png"
      },
      {
        "pagePath": "/pages/special/special",
        "text": "特殊",
        "iconPath": "/static/special.png",
        "selectedIconPath": "/static/special_actived.png"
      },
      {
        "pagePath": "/pages/mine/mine",
        "text": "我的",
        "iconPath": "/static/mine.png",
        "selectedIconPath": "/static/mine_actived.png"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    chooseActived(e) {
      const {
        path,
        index
      } = e.currentTarget.dataset;
      console.log('actived', this.data.actived)
      console.log('index', index)
      this.setData({
        actived: index
      }, () => {
        wx.switchTab({
          url: path,
        })
      })

      console.log('index', index, path)
    },
  }
})